#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
# File Name: main.sh
# Author: GID5564
# Description:在zsh系统下引导程序
# Created Time: 03/07/22-15:54:43
#※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
#! /usr/bin/env bash

export BOOT_MAIN=${BASH_SOURCE[0]:-$0}
function __main_init__(){
    local script_dir=$(cd "$(dirname "${BOOT_MAIN}")" &>/dev/null && pwd -P)
    export XSHELL_PATH="${script_dir%/*}"
    source ${XSHELL_PATH}/xlib/core.sh
    import system
}

function __import_lib__(){
    #加载所有xlib文件
    #__reload__ "${XSHELL_PATH}/xlib"
    import message
    import log
    import base
    import var
    import ini
    import config
    import string
    import git
    import cmd
    import xmenu
    import mail
    import backup

}

function __import_funcs__(){
    import var
    import dynamic
    import invoke
    import "funcs/install_package"
    import "funcs/install_python"
    import "funcs/problem_handling"
    import "funcs/send_mail"
    import "funcs/local_settings"
    import "funcs/open_website"
    import "funcs/install_jupyter"
    
    import call_entry
    import menu
    #import virtualenv
    import cmd_show
    import built_in_install
}

function __main__(){
    #检测系统支持
    local support=$(check_system)
    [[ $support -eq 1 ]] && {
        #支持
        __import_lib__
        __import_funcs__
        #show_system_information
        _show_command_menu_ "command"
    } || {
        warn "${YELLOW}$(uname -o)发行版本${RESET}${RED}不支持${RESET}${YELLOW}您当前的操作!${RESET}"
        uname -a
        exit 1
    }
}

__main_init__
__main__






























